package com.czz.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czz.portal.entity.CourseDescription;
import com.czz.portal.mapper.CourseDescriptionMapper;
import com.czz.portal.service.CourseDescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName: CourseDescriptionImpl
 * @Author Czz
 * @Date 2020/2/8
 * @Time 18:16
 **/
@Service
public class CourseDescriptionImpl extends ServiceImpl<CourseDescriptionMapper, CourseDescription> implements CourseDescriptionService {

    @Autowired
    CourseDescriptionMapper courseDescriptionMapper;

    @Override
    public CourseDescription getDescriptionByCourseId(String id) {
        QueryWrapper<CourseDescription> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("course_id", id);
        CourseDescription description = courseDescriptionMapper.selectOne(queryWrapper);
        return description;
    }
}
